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

Prepare for the dynamic aspects of the site #50

Open
12 tasks done
cdchapman opened this issue Nov 1, 2016 · 4 comments
Open
12 tasks done

Prepare for the dynamic aspects of the site #50

cdchapman opened this issue Nov 1, 2016 · 4 comments
Milestone

Comments

@cdchapman
Copy link
Member

cdchapman commented Nov 1, 2016

Or we need some way to build and compartmentalize both the static and dynamic aspects of the site to prepare the way for the dynamic aspects of the site (issue #14).

Here is what I envision as possible dynamic aspects of this site:

My question is really: how do we separate the static content and the server configuration files (which we don't want to serve) when we build them together? Or is there a way to build them separately?

On some level, I don't think we will need the dynamic server functionality for most content development, but then again, why have an arbitrary separation or complex, variable process when we don't have to? Either way an HTTP server is running; this issue is only about how to dynamically change the server and the server configuration. Issue #33 is related to this.

Here are a few requirements:

  • There should as no difference in functionality between environments (i.e. all commands should work and do essentially the same thing)
  • It should still be possible to run nanoc view and functionally view the static site
  • It should be possible to use a static_only environment to build the static stuff only
  • Server configuration should not output in a way that they could be served via HTTP
  • Have the ability to use environments to set different output paths for content and server configurationactually this is not needed for development or deployment, as I thought it might

I like the approach below. Here is what would need to be done to implement it:

  • Move the items directory to content
  • Adjust nanoc.yaml accordingly
  • Update site rules to deal with these new item identifiers
  • Use site config and rules to dynamically set the root of the outputted item paths (see comment below)
  • Patch the nanoc view command that takes the configuration for the static root into account
  • Patch link_to to remove the /static/ root for link generation
  • Update sitemap and blog feed (see issue Redesign ATOM-feed helper #21) helpers to use the public_path_to helper
  • Add a static_only environment that ignores all of the server items during the build (see another comment below)

Would be nice to do to know that this setup actually works:

@cdchapman cdchapman added this to the 2.0 milestone Nov 1, 2016
@cdchapman cdchapman changed the title Use @config to set content_root and server_config_root for outputted files Use site config to set content_root and server_config_root for outputted files Nov 1, 2016
@cdchapman
Copy link
Member Author

cdchapman commented Nov 3, 2016

Having separate environments for content and server configs may be one way to handle this

For example:

.
└─ output
   └─ app
      ├─ app.lua
      ├─ content # ← into this folder would the static files be built
      └─ …

To do this, we could either arrange the files in the items directory in such a pattern, or what might be better would be to use two filesystem datastores: one for the static content, and one for the server configuration.

.
├─ content
│  ├─ assets
│  ⋮
│  └─ specifications.erb
└─ server
   ├─ app.moon
   ├─ nginx.conf
   └─ views

and use a different items_root for the content filesystem. Going back to placing the static items in the content directory may also be a little more conventional for a nanoc build.

@cdchapman cdchapman changed the title Use site config to set content_root and server_config_root for outputted files Use site config to set static_root and dynamic_root for outputted files Nov 3, 2016
cdchapman added a commit that referenced this issue Nov 4, 2016
@cdchapman
Copy link
Member Author

cdchapman commented Nov 7, 2016

The more I think about this, I'm wondering whether it would be best to simply use one filesystem datasource, and use this for both the static and dynamic parts, arranging it in a unified way. I think this would give a structure that was more consistent, expected, and simple.

Such an approach could look like this:

.
└─ items
   ├─ app.moon
   ├─ nginx.conf
   ├─ static
   │  ├─ assets
   │  ├─ blog
   │  │  └─ index.erb
   │  ⋮
   │  ├─ specifications.erb
   │  └─ videos
   └─ views

So the content_dir and the output_dir would have an analogous structure. This would also give us the flexibility to decide which items should be generated statically and which would work better as dynamic.

@cdchapman cdchapman changed the title Use site config to set static_root and dynamic_root for outputted files Prepare for the dynamic aspects of the site Nov 7, 2016
@cdchapman
Copy link
Member Author

cdchapman commented Nov 9, 2016

I don't see the reason anymore to have the static_only environment, unless it is to avoid filters that require lua or other dependencies. So keep the environment for now, but if we find it is not useful, get rid of it in the future.

@cdchapman
Copy link
Member Author

I want to revisit storing the static root under the dynamic items. It makes most of the paths when editing one level deeper. Beyond that it seems like we're dealing with two different logics here, and that a separation would be useful as we move forward.

@cdchapman cdchapman reopened this Nov 27, 2019
@cdchapman cdchapman pinned this issue Dec 10, 2019
cdchapman added a commit that referenced this issue Dec 15, 2019
Overhauled company data source to simplify and better handle x509
certificates.
Restructured Nanoc identifiers to be simpler and more consistent.
Clarified requirement and creation of the web_id attribute.
Simplified helpers by moving some (NOT YET ALL) item creation code to
Nanoc data sources (#86).
Restructured relevant text helpers to directly extend String class.
Remove spurious text helper methods that were already provided by
activesupport.
Remove the to_slug helper method.
Updated many hard-coded item identifier references to use site config.
Introduced WIP personal profile pages, replacing author pages.
Updated account_service_item render call on the company page, missed in
8dbe352
Updated rules to use the new identifiers.
@cdchapman cdchapman modified the milestones: 2.4, 3.0 Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant