GithubHelp home page GithubHelp logo

grav-plugin-anchors's People

Contributors

flaviocopes avatar lauroguedes avatar pamtbaau avatar rhukster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

grav-plugin-anchors's Issues

error in readme

anchor.js isn't a jQuery plugin, it's a vanilla js plugin! (no dependencies at all)

Anchors for other languages

When I create new page in Admin panel, I see transliteration:
image

But when I create new <h2> header with ## and only with RU string, then no anchors created:

http://mygravlearn/basics/instruction#

Any ideas how to fix?
Can I specify anchor by hands somewhere?

converting diacritics (accented characters and so on) in anchors

I noticed that Anchors will not convert diacritics (accented characters like à, é, ü, or others like ç) but drops them.

For instance, on this page "Colophon" will correctly render as info#colophon, but "Mentions légales" will become info#mentions-lgales — notice how the "é" was not converted into an "e"?

Anchors are not very visible to the end-user, of course, but this is a bit awkward when creating links by hand to anchors elsewhere on our sites. For the example above, I'd have expected the anchor to be info#mentions-legales instead of info#mentions-lgales.

If this could help you, the TOC plugin does this conversion correctly (but "uglifies" anchors by underlining them - and I prefer your visual to indicate them anyway)

Not a show-stopper, but it would be nice if you could manage to correct this.

Thank you anyway, and best regards!

Cannot disable anchors in a specific page.

I cannot disable anchorjs in my custom error 404 page.

You can find the exact page setup I'm using here: https://github.com/RojerGS/mathspp/tree/master/pages/error.
And you can test it by accessing a random route in my website, e.g. https://mathspp.com/agadfasdfasdfaff.

My frontmatter.yaml looks like this:

anchors:
    active: false
    enabled: false
http_response_code: 404
metadata:
    author: Rodrigo Girão Serrão
routable: false

and my default.en.md looks like this:

---
title: Error
---
<center><h1>Error 2×2×101</h1>

Woops. Looks like this page doesn't exist.
</center>

But for some reason, the anchor to the h1 title is there.

Swedish special chars

Disclaimer: i know nothing of JS, very little about Grav and less about github (=

Found that i had some problems with the swedish special chars "Å Ä Ö" in the anchor links and the auto-generated menu.

Solved this by adding

'å','ä',

to the "$rx1 = array" of AnchorsTwigExtension.php

and adding

.replace(/å/g, '').replace(/Å/g, '').replace(/ä/g, '').replace(/Ä/g, '').replace(/ö/g, '').replace(/Ö/g, '')

just before .toLowerCase() in anchors.min.js

Is this me not using the plugin the right way or is there a need for updates similar to the above?

Did not make a pull-request because i'm not sure how to actually do it and almost certain there is a better way to do these changes.

Question : Show Menu of Anchors

Hello, thanks for you job.
I'm really sorry but i'don't understand your demonstration.

just put the function below in the template file twig:
anchors(content, tag, terms)

Do you share example ? i'm not a good developper so i need more.

truncate option ignores setting for twig function

Dont confuse this with #20 which is related to javascript, not the twig php extension.

The current code ignores the truncate setting in the config completely. It shorts ids to 64 characters and titles to 50 - always.

Install fails with a RuntimeException when attempting to copy non-existant file

Can confirm that file doesn't exist locally (though I noticed it does here). Install looks to otherwise perfectly fine, and plugin appears to run correctly. Failing command follows:

root@e881e4b4fb57:/usr/share/nginx/html# bin/gpm install -y error problems breadcrumbs anchors highlight simplesearch learn2

GPM Releases Configuration: Stable



Preparing to install Error [v1.6.0]
  |- Downloading package...   100%
  |- Checking destination...  ok
  |- Installing package...    ok
  '- Success!

Preparing to install Problems [v1.4.7]
  |- Downloading package...   100%
  |- Checking destination...  ok
  |- Installing package...    ok
  '- Success!

Preparing to install Breadcrumbs [v1.5.1]
  |- Downloading package...   100%
  |- Checking destination...  ok
  |- Installing package...    ok
  '- Success!

Preparing to install Anchors [v1.5.2]
  |- Downloading package...   100%
  |- Checking destination...  ok
  |- Installing package...

  [RuntimeException]
  copy(/usr/share/nginx/html/user/plugins/anchors/.idea/vcs.xml): failed to open stream: No such file or directory

I noticed that a recent commit introduced the file its complaining about. No idea how Grav works underneath, but is it possible the new file is giving it grief?

Menu of Anchors : Error ArgumentCountError

Hello,

I'm trying to have an auto-generated menu like explained in the docs.

Problem:

Too few arguments to function Grav\Plugin\AnchorsTwigExtension::anchorsFunction(), 2 passed in XXX\user\plugins\anchors\twig\AnchorsTwigExtension.php on line 63 and exactly 3 expected

What I did:

  • I've added {{ anchors(page.content, 'li') }} in my .md file
  • I've added this in the frontmatter of the same .md file
process:
    twig: true

It seems like I'm missing an argument, but even if I write {{ anchors(page.content, 'li', '') }} I have the same error.

Am I missing something ?

PS: Everything is up to date

anchorjs version is outdated

Please update to the last version of anchorJs because some éléments of the official documentation are not compatible with the version provided with the plugin.
Happily , a manuel update is possible just by replacing the anchor.min.js file by the latest version avalaible

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.