Add default landing page with link builder (#114) #119
Reference in New Issue
Block a user
Delete Branch "mmarhin/autogits:default-page"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR introduces the initial HTML structure for the default landing page (root URL).
Changes included:
static/index.htmlwith the basic form and layout (using PicoCSS).main.goto serve the static file on the/path.Status:
The HTML is static; the JavaScript logic to dynamically update the "Preview" and "Link" sections based on user input is missing and will be implemented in the next steps.
Relates to #114
WIP: Add default landing page with link builder (#114)to Add default landing page with link builder (#114)I have pushed the full implementation.
Sorry for the commit noise/reverts in the history; I encountered a small issue where
.gitignorewas filtering out the SVG assets, so I had to revert and re-apply the changes to include them properly.Summary of the latest changes:
script.jsto handle real-time preview updates and link generation (Markdown/URL).style.cssto customize PicoCSS with openSUSE branding colors (Green).main.goto properly serve static files from the/static/directory.The feature is now fully functional and ready for review.
@@ -0,0 +123,4 @@<hr /><section>I think that there's no need to add all the information, sections from here to the end can be removed.
Done @dgarcia! Cleanup complete.
Looks pretty good. But there's a lot of custom css. It could be better to use the defaults defined in the picocss. Instead of defining custom colors and css properties, it will be better to use standard components and just customize some variables in the style.css.
@@ -0,0 +1,129 @@<!DOCTYPE html><html lang="en" data-theme="dark">Maybe we should remove the
darktheme and let the browser show the user preferred theme.That will require to adapt all the css and replace all custom colors there with some existing color defined in the picocss
@@ -0,0 +21,4 @@}// Build the path correctly with all componentslet path = '/status/' + encodeURIComponent(project);I don't think that the
encodeURIComponentis needed, we can show the path without encoding so the link looks clean and easier to understand.@@ -0,0 +23,4 @@// Build the path correctly with all componentslet path = '/status/' + encodeURIComponent(project);if (pkg) {path += '/' + encodeURIComponent(pkg);Same as above.
@@ -0,0 +37,4 @@// Force reload of object to ensure it updates even if path is similar or cachedconst newPreview = preview.cloneNode(true);newPreview.data = path;preview.parentNode.replaceChild(newPreview, preview);Updating the preview here directly is creating a request to the server for each character, and producing broken images while writing. To prevent that we can add a timeout to avoid the reload before stop typing, something like:
The
timeoutIDvariable should be a global variable defined as 0 by default.Or we can even debounce the whole
updatePreviewfunction.@dgarcia Thanks for the detailed feedback! I've applied all the requested changes:
Changes made:
data-theme="dark"--pico-lime-600,--pico-lime-700, etc.) and removed unnecessary styling. CSS reduced from ~320 to ~150 lines.encodeURIComponentfrom path building for cleaner, more readable linksupdatePreview()to prevent server requests on every keystrokeThe interface now relies much more on PicoCSS defaults while maintaining the openSUSE branding through the color variables.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.