-
Notifications
You must be signed in to change notification settings - Fork 3
wip: add live reload to site generator #103
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
base: master
Are you sure you want to change the base?
Conversation
…nable live-reloading of markdown entries.
…oading files skip over directories, and a fix for the AdHocMarkdownImporter.
@@ -159,7 +159,22 @@ def destroy | |||
end | |||
|
|||
def files | |||
blob = @entry.files.blobs.find_by!(filename: params[:filename]) | |||
# TODO: test this obviously insane behaviour |
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 think i did this in order to support not-yet-important files as entries. but why did i do this in the normal entries controller as opposed to the static entries controller?
@@ -70,7 +89,7 @@ def serve_blob(blob) | |||
end | |||
|
|||
response.headers["Content-Type"] = content_type || ActiveStorage::BaseController::DEFAULT_SEND_FILE_TYPE | |||
response.headers["Content-Disposition"] = disposition || ActiveStorage::BaseController::DEFAULT_SEND_FILE_DISPOSITION | |||
# response.headers["Content-Disposition"] = disposition || ActiveStorage::BaseController::DEFAULT_SEND_FILE_DISPOSITION |
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.
????
if occurred_at.blank? | ||
# let's try to guess it from the file | ||
basename = File.basename(md_path) | ||
date = basename.match(/([0-9]{4}-*[0-9]{2}-*[0-9]{2}-*)/).to_a[0] |
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.
like, c'mon, isn't this nuts? this is a cute hack but if i give up on being able to parse random files in a random folder structure, it's obvious i should just define this in the frontmatter 🤔
|
||
# TODO: DON'T DO THIS GIT DOESN"T SET CTIME!!!!!! | ||
created_at = parsed_file["created_at"] || File.ctime(md_path) | ||
updated_at = parsed_file["updated_at"] || File.mtime(md_path) |
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 actually has caused all sorts of annoying issues when regenerating the site, cos the updated at will reflect the disk mtime & not the last time the file was actually modified.
@@ -0,0 +1,29 @@ | |||
require 'html/pipeline' | |||
|
|||
class PipelineFilter::LinkRelativizer < HTML::Pipeline::Filter |
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.
WHY DID I WRITE THIS lmao
why am i rewriting urls? was something not showing properly in non static mode? (oooh was this because /foo.png
might clash against user/name
?)
i started working on this featureset in february and then………… life got in the way and i forgot this branch even existed.
i think my goals originally were to find a way to have life file reloading so i could iterate on my blog without having to re-import the whole site every time. i almost immediately bit off more than i could chew and then………… life got in the way.
so now i want to take a step back. since i began this branch i've decided to give up on part of the original vision for mawl. i think i originally imagined i could build something not unlike 11ty - except i didn't know 11ty existed when i started working on it. now i'm like, this is an unrealistically wide goal. i spent a lot of time and got a bit burned out trying to make the importer intelligent enough to support random files in a folder and my specific note entry format.
instead of trying to make a static site generator for anyone to just point a folder of markdown at, i should instead try to make something that works for me, personally, and i think that means i want to write the posts from directly inside the arquivo note taking interface and have them render there.
so the whole static site modality needs to be walked back and cleaned up etc, but fortunately the path forward should be a bit clearer now.
as i write this i am using this pr to walk thru the experiments i engaged in earlier this year & get this to some mergeable state.