-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: add site title, author, and description to layouts #41
Fix: add site title, author, and description to layouts #41
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clojure/src/firn/layout.clj
Outdated
@@ -160,6 +160,9 @@ | |||
:site-map (config :site-map) | |||
:site-links (config :site-links) | |||
:site-logs (config :site-logs) | |||
:site-title (config :site-title) | |||
:site-author (config :site-author) | |||
:site-desc (config :site-desc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! Do you mind updating the docs table to match the updated layout vals?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, the templates for the docs site can also be updated to include a title, author, and description.
@@ -1,8 +1,8 @@ | |||
(defn default | |||
[{:keys [render partials build-url]}] | |||
[{:keys [render partials build-url site-title site-author site-desc]}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[{:keys [render partials build-url site-title site-author site-desc]}] | |
[{:keys [render partials build-url site-title site-author site-desc] :as config}] |
We should probably just keep the map value around so that we can pass it to the head
partial`, then update the head partial to deconstruct what it needs from the config map.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call.
(let [{:keys [head]} partials] | ||
[:html | ||
(head build-url) | ||
(head build-url site-title site-author site-desc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(head build-url site-title site-author site-desc) | |
(head config) |
@@ -1,7 +1,10 @@ | |||
(defn head | |||
[build-url] | |||
[build-url site-title site-author site-desc] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[build-url site-title site-author site-desc] | |
[{:keys [build-url site-title site-author site-desc]}] |
db669a6
to
3fa6dd8
Compare
A couple questions @teesloane:
|
Nah, I kind of forgot about that test. It's a bit flimsy. I think I made it to make sure that config property names aren't being overwritten or removed. You can either add the new keys or leave it for a better test in the future.
I've actually just borrowed my commit leaders from here — and didn't know about conventional commits. Going forward (if not now, then at least at first major release) I think this might be a good choice. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot that values from config.edn
are loaded into the submap user-config
and so need to be accessed at (-> config :user-config :the-value)
Updated to correctly get user config values and I'm able to verify it now: I can clean up and squash my commits if everything else looks good @teesloane. |
I did run into an issue with a circular dependency in org.clj. This looks like a bug to me, but I wanted to check first to see if you are running into it too @teesloane: |
Looks good! As for the circular dependency - you are requiring |
- Add site title, author, and description to layouts public-api for SEO and accessibility. - Update default layout - Update head partial - Make meta charset casing consistent with other attributes - Update metadata table - Add site-author, site-desc, and site-title - Add site-url - Add firn-tags data type - Alphabetize and format
2e3c15e
to
4468f43
Compare
I squashed my commits. The circular dependency comment was unrelated to this PR. I thought it would be better to create a separate one to remove it: #42. |
Thanks! Merged both! |
- Add site title, author, and description to layouts public-api for SEO and accessibility. - Update default layout - Update head partial - Make meta charset casing consistent with other attributes - Update metadata table - Add site-author, site-desc, and site-title - Add site-url - Add firn-tags data type - Alphabetize and format
Hey @teesloane, I noticed that there is no site title or meta author and description. Can they be added for SEO and accessibility?
https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/The_head_metadata_in_HTML#Adding_an_author_and_description
I haven't been able to get my development env working yet with GraalVM to test these changes, but I wanted to check first before I go any further in case you had other plans.