statiqdev / cleanblog Goto Github PK
View Code? Open in Web Editor NEWA blogging theme for Statiq Web.
License: MIT License
A blogging theme for Statiq Web.
License: MIT License
There are many parsers who can't parse relative open graph URIs so it's better to use absolute URI's in the layout file
Currently hardcoded into
CleanBlog/input/_footer.cshtml
Line 5 in f732ab7
My expectation would be for it to use WebKeys.Copyright
, I'll propose a PR for that.
Wanted to give this theme a go, so decided to follow the instructions and I'm getting the following error.
[ERRO] Archives/Process » ForEachDocument » Error while executing module ExecuteConfig in Archives/Process: Value cannot be null. (Parameter 'patterns')
[ERRO] Archives/Process » ForEachDocument » Document [C:/Users/drmathias/repos/ThemedBlog/src/ThemedBlog/input/theme/input/index.cshtml]: Exception of type 'Statiq.Core.ExecuteModulesException' was thrown.
[DBUG] Exception while executing pipeline Archives/Process: System.ArgumentNullException: Value cannot be null. (Parameter 'patterns')
at Statiq.Core.FilterSources..ctor(IEnumerable1 patterns) at Statiq.Web.Pipelines.Archives.<>c__DisplayClass0_0.<.ctor>b__1(IDocument archiveDoc, IExecutionContext ctx) at Statiq.Common.Config.<>c__DisplayClass13_0
1.b__0(IDocument doc, IExecutionContext ctx)
at Statiq.Common.Config1.<>c__DisplayClass10_0.<<op_Implicit>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Statiq.Common.Config
1.GetAndTransformValueAsync(IDocument document, IExecutionContext context, Func2 transform) at Statiq.Common.ParallelConfigModule
1.<>c__DisplayClass8_1.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Statiq.Common.ParallelAsyncExtensions.ParallelSelectManyAsync[TSource,TResult](IEnumerable1 items, Func
2 asyncSelector, CancellationToken cancellationToken)
at Statiq.Common.ParallelConfigModule1.ExecuteContextAsync(IExecutionContext context) at Statiq.Common.Module.ExecuteAsync(IExecutionContext context) at Statiq.Common.Module.ExecuteAsync(IExecutionContext context) at Statiq.Core.Engine.ExecuteModulesAsync(ExecutionContextData contextData, IExecutionContext parent, IEnumerable
1 modules, ImmutableArray`1 inputs, ILogger logger)
Steps to reproduce:
git submodule add https://github.com/statiqdev/CleanBlog.git theme
my-first-post.md
at input/posts/
When migrating from an old blog or when cross-posting it's important to not hurt SEO to have Canonical URL pointing to the original post.
I propose an optional Canonical
config is added to documents handled by the template.
I'll send a small proposed fix PR to this for review.
This is a theme, as I understand it -- so it should have the structure of:
theme
|
- input
|
- css
- html
(etc.)
however, the structure of this repository is just:
input
|
-css
-html
Is that purposeful / should it be updated to be the structure that consumers would expect a theme to have?
I’d like to change the default number of posts listed on the home page to be more than 3.
From index.cshtml is there an easy way to change this value ArchivePageSize: 3
without having to add my own index.cshtml
page in my projects input
folder?
Could this be an appsettings.json
value?
In appsettings.json
{ "GenerateSearchIndex": true }
doesn't go to deployed path.
If you are hosting via GitHub pages but not on the root repo what are the settings needed to make search work?
Seeing this invalid URL being logged in browser console for a post with image:
front matter
GET
http://localhost:5080/2023/12/"/assets/2023/01/terraform-logo.png"
Looks like the double quotes in
CleanBlog/input/_header.cshtml
Line 12 in ad63989
FIrstly thankyou for a fabulous framework!
I'm trying to set up my blog with Statiq and have been following the docs to set up the generator, and then the page on themes to add the CleanBlog theme.
I've tried this twice, and each time the links in the generated html to the scss folder are invalid.
They are being generated as /scss/clean-blog.css, whereas really they ought to be ../scss/clean-blog.css, since the output files are in /output/posts.
I must be doing something wrong but I still can't figure out what it is.
Any help would be greatly appreciated!
See statiqdev/Website#32 - IIS gets fussy when there are extensionless files that have the same name as folders. Moving /posts.html
to /posts/index.html
(and likewise for tags.html
) seems like a simple way to guard against that without breaking anyone.
(No Discussions area here, hence the issue.)
The CleanBlog template supports an ImageAttribution
setting whose value is injected as raw HTML by Razor code.
Would it be possible to support Markdown in settings instead? I don't need a full explanation, just a feasibility statement from someone knowing Statiq's internals better than I do (hint: I know next to nothing besides what's in the Guide).
I have just noticed that my RSS and atom feeds are empty, like there was not article to display in it. As far as I know I have the latest version of Statiq.dev and of the Clean Theme, and no specific configuration for the feeds. I don't know if it's a bug or not (could other people confirm that it's working fine on their website?). If it's only me, how could I debug that to see what is not working properly?
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title />
<link>https://techwatching.dev/</link>
<description />
<copyright>Copyright © 2023</copyright>
<pubDate>Sun, 12 Mar 2023 15:19:03 GMT</pubDate>
<lastBuildDate>Sun, 12 Mar 2023 15:19:03 GMT</lastBuildDate>
</channel>
</rss>
My repository is here
The current DestinationPaths example at https://github.com/statiqdev/CleanBlog#destination-paths
DestinationPath: => $"{Document.GetDateTime("Published").ToString("yyyy/MM")}/{Document.Destination.FileName}"
Results in files that have a .md suffix, which I'm pretty sure is not what you'd want
As reported by @atiq-cs in #25 (comment):
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.
Do you have a sample backend generator for this?
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.
IsArchive
setting (I could do this directly in #23 before it gets merged).pages
folder under input
with an about.md
file (that will be overridden by users) to demonstrate the feature.PageSources
and IsPage
settings in settings.yml
:PageSources: pages/**/*
IsPage: => Outputs.FilterSources(Context.GetString("PageSources")).ContainsById(Document)
_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.
IsArchive
was used to tell apart pages from infrastructure.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)?
Hello can you share a sample for a dashboard or a business app, where we can tailor the _partials in the input templates for tables, cards etc.
Is there any use case of masthead image per post? If there is none probably having global (one per site) masthead is image enough as specified in settings.yml
?
Sorry, putting it here, not sure where else to discuss. This is related to the CleanBlog's implementation of masthead support.
Hello. I'm trying to port my blog to Statiq, using this theme.
My old blog uses Markdown files with this kind of Frontmatter:
---
title: "3 ways to inject DateTime and test it"
path: "/blog/inject-and-test-datetime-dependency"
tags: ["CSharp", "Tests", "MainArticle"]
featuredImage: "./cover.jpg"
excerpt: "DateTime, Guid, and Random values are not under your direct control. You should abstract them to write better code and testing. We'll see 3 ways to inject and test them in .NET Core projects."
created: 2021-01-12
updated: 2021-01-12
---
I'm looking for a way to adapt the "old" structure with the one required by this theme.
In particular, I'll have to map
title
=> Title
created
=> Published
excerpt
=> Lead
Then, I'll also have to perform 2 transformations:
path
must be used as Destination Path ( how can I customize the example DestinationPath: => $"{Document.GetDateTime("Published").ToString("yyyy/MM")}/{Document.Destination.FileName}"
? )
Then, how can I define the cover image for each blog post, using the one defined in the featuredImage
field?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.