marinebon / fk-iea

Florida Keys NMS + IEA + MBON infographics
https://marinebon.github.io/fk-iea/
MIT License
0 stars 0 forks source link

+ :pencil2: edit this page button #11

Open 7yl4r opened 5 years ago

7yl4r commented 5 years ago

The book theme demo page showcases a "Edit this page" link at the bottom of each page and post.

Our config.toml looks correct and I think this should be working.

I dug into it a bit more and found that this is the "docs/git-footer" partial and thus is only included for pages rendered from "./content/docs/". In an attempt to work around this I added the relevant line {{ partial "docs/git-footer" . }} from ./themes/book/layouts/docs/baseof.html and added it to /home/tylar/fk-iea/layouts/modals/baseof.html. After building the site the link is not there. I also do not see the <div class="book-footer which should be there. I am pushing this attempt on a new branch called edit-btn.

7yl4r commented 5 years ago

Here's a different approach: what if we just rename posts->docs? Well... then the toc partial gets broken, I think because we have no posts. Perhaps we can also rename modals->posts?

7yl4r commented 5 years ago

what if we just rename posts->docs? [...] also rename modals->posts?

This works! Partially... Because blogdown renders to html before hugo is called we end up with links that try to edit the html files. The button does work as intended for .md files.

Still no ToC :man_shrugging:

Pushed to yet another new branch called edit-btn-mv

bbest commented 5 years ago

Inserting "Edit on GitHub" Buttons in a Single R Markdown Document | R-bloggers