Skip to content
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

Implement the concept of "page", with a dedicated "pages" folder like Jekyll #25

Closed
rdeago opened this issue Oct 26, 2022 · 6 comments
Closed

Comments

@rdeago
Copy link
Contributor

rdeago commented Oct 26, 2022

Background and motivation

The upstream project distinguishes between a "post" a "page" and a... "neither-post-nor-page", let's call it "infrastructure" (home, posts, tags).

As far as I can tell, the only current difference between the three kinds of pages should be the CSS class of the title / description <div>: post-heading for posts, page-heading for pages, site-heading for infrastructure. However, the conceptual distinction is more important than just the CSS class, because the StartBootstrap team may decide to, say, use different masthead colors for posts and pages, and we wouldn't be able to implement that if we can't tell what a "page" is.

#23 adds an IsArchive setting which is similar in purpose (a "neither-post-nor-archive" is a "page") but an IsPage setting would probably make more sense, as it maps easily to the concept of "page" in Jekyll, Wordpress, and probably others.

Implementation

  • Remove the IsArchive setting (I could do this directly in Update dependencies, refactor styles and scripts, add some goodies #23 before it gets merged).
  • Add a pages folder under input with an about.md file (that will be overridden by users) to demonstrate the feature. (EDIT: no sense in forcing a page to exist on user sites; a decently-written section in README will do)
  • Add PageSources and IsPage settings in settings.yml:
PageSources: pages/**/*
IsPage: => Outputs.FilterSources(Context.GetString("PageSources")).ContainsById(Document)
  • Change line 16 of _header.cshtml from this:
        <div class="@(isPost ? "post-heading" : "site-heading")">

to this:

        <div class="@(isPost ? "post-heading" : isPage ? "page-heading" : "site-heading")">

Styling for the page-heading class is already implemented and imported, we just never got to see it so far.

  • Make all other necessary changes wherever IsArchive was used to tell apart pages from infrastructure.

Incompatibilities

An existing blog's "About" page will not see any changes, unless the author adds IsPage: true to front matter.

If an author wants to keep existing pages in input they have to exclude the pages folder from processing; it shouldn't be hard AFAIK, but I'd advise moving pages under pages and using redirects instead.


@daveaglick any thoughts? Should I add this to #23 instead of the IsArchive mess (admittedly of my creation)?

@rdeago rdeago changed the title Implement the concept of "page", _à la_ Jekyll Implement the concept of "page", with a dedicated "pages" folder like Jekyll Oct 26, 2022
rdeago added a commit to rdeago/Statiq-CleanBlog that referenced this issue Oct 28, 2022
@rdeago
Copy link
Contributor Author

rdeago commented Oct 28, 2022

Changes already pushed to #23. @daveaglick I'm sorry for not even waiting for your reply, but the IsArchive hack just had to die.

@atiq-cs
Copy link
Contributor

atiq-cs commented Nov 30, 2022

ditto: multiple PRs with small amount of changes is much better

@rdeago
Copy link
Contributor Author

rdeago commented Dec 1, 2022

@atiq-cs I fail to see how this issue could be split. The bullet points under "Implementation" make little to no sense if singled out.

Anyway, this issue is moot since the problem was created halfway in #23 and the fix is already in a later commit in #23. Even if #23 gets abandoned in favor of smaller PRs, I'll just avoid creating the problem in the first place.

@rdeago rdeago closed this as completed Dec 1, 2022
daveaglick pushed a commit that referenced this issue Dec 5, 2022
@atiq-cs
Copy link
Contributor

atiq-cs commented Aug 6, 2023

Hi Guys,
It's been a while. Hope you are doing great!

Change in this commit 8c248f0 as part of this PR has regressed build performance. As a result of that, our large blog with 819 posts has started failing since pulling in this change. Our blog successfully builds till commit 8c248f0 is pulled.

To provide more context, our blog usually builds in 6 minutes. Since pulling this change / commit 8c248f0 it has been building for forever. It's also failing on the cloud instance since pulling in this change due to time outs. I request re-reviewing the change introduced and what changed that increased build time dramatically!

Please let me know if you need any other debug / diagnostic info.

Here's output of -- preview,

dotnet run -- preview
[INFO] Statiq Framework version 1.0.0-beta.70+625bd4754bf14f3c6a860587c6d747f4850b1c13
[INFO] Statiq Web version 1.0.0+7f3b58623a7e4ad2542635168bf49d12bb09c299
[INFO] Root path:
       D:/Code/statiq/triage.rdeago
[INFO] Input path(s):
       theme/input
       input
[INFO] Output path:
       output
[INFO] Temp path:
       temp
[INFO] Cache path:
       cache
[INFO] ========== Execution ==========
[INFO] Executing 11 pipelines (AnalyzeContent, Archives, Assets, Content, Data, DirectoryMetadata, Feeds, Inputs, Redirects, SearchIndex, Sitemap)
[INFO] Absolute Execution Date/Time: 2023-08-06 14:32:52
[INFO] Configured Current Date/Time: 2023-08-06 14:32:52
[INFO] Minimum Configured Log Level: Information
[INFO] Cleaned temp directory D:/Code/statiq/triage.rdeago/temp
[INFO] Restored write tracking data from D:/Code/statiq/triage.rdeago/cache/writecache.json
[INFO] Restored Razor compilation cache from D:/Code/statiq/triage.rdeago/cache/razorcache.json with 825 assemblies
[INFO] -> Inputs/Input » Starting Inputs Input phase execution... (0 input document(s), 1 module(s))
[INFO] -> DirectoryMetadata/Input » Starting DirectoryMetadata Input phase execution... (0 input document(s), 1 module(s))
[INFO] <- DirectoryMetadata/Input » Finished DirectoryMetadata Input phase execution (0 output document(s), 217 ms)
[INFO] -> DirectoryMetadata/Process » Starting DirectoryMetadata Process phase execution... (0 input document(s), 1 module(s))
[INFO] <- DirectoryMetadata/Process » Finished DirectoryMetadata Process phase execution (0 output document(s), 1 ms)
[INFO] <- Inputs/Input » Finished Inputs Input phase execution (837 output document(s), 423 ms)
[INFO] -> Inputs/Process » Starting Inputs Process phase execution... (837 input document(s), 8 module(s))
[INFO] <- Inputs/Process » Finished Inputs Process phase execution (836 output document(s), 6106 ms)
[INFO] -> Data/Process » Starting Data Process phase execution... (0 input document(s), 5 module(s))
[INFO] -> Assets/Process » Starting Assets Process phase execution... (0 input document(s), 3 module(s))
[INFO] <- Data/Process » Finished Data Process phase execution (0 output document(s), 29 ms)
[INFO] -> Content/Process » Starting Content Process phase execution... (0 input document(s), 4 module(s))
[INFO] <- Content/Process » Finished Content Process phase execution (809 output document(s), 2407 ms)
[INFO] -> Archives/Process » Starting Archives Process phase execution... (0 input document(s), 3 module(s))
[INFO] <- Assets/Process » Finished Assets Process phase execution (23 output document(s), 3453 ms)
[INFO] <- Archives/Process » Finished Archives Process phase execution (880 output document(s), 87658 ms)
[INFO] -> Feeds/Process » Starting Feeds Process phase execution... (0 input document(s), 3 module(s))
[INFO] <- Feeds/Process » Finished Feeds Process phase execution (2 output document(s), 32270 ms)
[INFO] -> SearchIndex/PostProcess » Starting SearchIndex PostProcess phase execution... (0 input document(s), 1 module(s))
[INFO] <- SearchIndex/PostProcess » Finished SearchIndex PostProcess phase execution (0 output document(s), 0 ms)
[INFO] -> SearchIndex/Output » Starting SearchIndex Output phase execution... (0 input document(s), 1 module(s))
[INFO] <- SearchIndex/Output » Finished SearchIndex Output phase execution (0 output document(s), 3 ms)
[INFO] -> Sitemap/PostProcess » Starting Sitemap PostProcess phase execution... (0 input document(s), 1 module(s))
[INFO] -> Assets/Output » Starting Assets Output phase execution... (23 input document(s), 2 module(s))
[INFO] -> Data/Output » Starting Data Output phase execution... (0 input document(s), 2 module(s))
[INFO] <- Data/Output » Finished Data Output phase execution (0 output document(s), 0 ms)
[INFO] -> Content/PostProcess » Starting Content PostProcess phase execution... (809 input document(s), 1 module(s))
[INFO] <- Assets/Output » Finished Assets Output phase execution (23 output document(s), 36 ms)
[INFO] -> Archives/PostProcess » Starting Archives PostProcess phase execution... (880 input document(s), 1 module(s))
[INFO] -> Feeds/Output » Starting Feeds Output phase execution... (2 input document(s), 2 module(s))
[INFO] <- Feeds/Output » Finished Feeds Output phase execution (2 output document(s), 4 ms)
[INFO] <- Sitemap/PostProcess » Finished Sitemap PostProcess phase execution (1 output document(s), 99 ms)
[INFO] -> Sitemap/Output » Starting Sitemap Output phase execution... (1 input document(s), 1 module(s))
[INFO] <- Sitemap/Output » Finished Sitemap Output phase execution (1 output document(s), 7 ms)
[INFO] [Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager] User profile is available. Using 'C:\Users\Atiq\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.

@atiq-cs
Copy link
Contributor

atiq-cs commented Aug 6, 2023

@daveaglick need to re-open this issue please if it makes sense from above!

@rdeago
Copy link
Contributor Author

rdeago commented Aug 8, 2023

@atiq-cs reopening this issue months after the fact wouldn't do much good IMHO, so I took the liberty of copying your post to new issue #34. If a fix is needed, it's better applied via a new PR at this point.

atiq-cs added a commit to atiq-cs/CleanBlog that referenced this issue Sep 25, 2023
atiq-cs added a commit to atiq-cs/CleanBlog that referenced this issue Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants