How to merge a template with a site? - hugo

Hugo works with themes one can download (or create from scratch). They live in their subfolder of the site root (namely themes).
When reading about customizing themes and playing along, I realized that a theme reproduces the structure of the root site (it has layout, static and similar folders, same as the root site).
Is it possible (and not discouraged) to copy a theme over the root of the site, and customize it from there?
I realize that I will lose the ability to update a theme, but it should not matter that much as i will heavily update it anyway. For completeness, I actually did the copy and my site did not change (it now now built without --theme=) but it may just be luck (or discouraged practices)

This is possible, yes. The main folders from the theme (layouts, static, archetypes, data, and i18n) can be copied over to the root site folder without any change in functionality. Other folders that you copy over will be ignored (e.g. exampleSite). Most files in the root directory (e.g. theme.toml) are also ignored. So you should be able to copy everything over and have it just work, unless the theme author decided to put a config.toml or a content directory in their repo.
However, probably the easiest way to modify a theme is to clone the git repository into the themes directory, create a new branch in git, and make your modifications there. That way you can use git to merge any changes from the main repository into your version. Without git, this takes a lot more work. It also makes it a lot easier to swap your custom theme for a different one - just add the new one to the themes directory and change your config.toml.

Related

Why are images inside my assets folder only displayed when the folder is outside the src-folder?

In two different ReactJS projects, I am working with images which are stored inside of an "assets"-folder. For some reason though, they are only found/displayed as long as the folder containing them is outside the source folder. Why is that?
Without knowing more details about both projects it's not possible to say which specific part of the project is causing this. However, if the issue is that moving the assets folder around does not break things until you move it into the source folder, this will most likely be due to whichever deployment system you use not making raw source files available as assets.
If the issue is just that moving or renaming the assets folder prevents you from being able to access it, then that will be down to the configuration of your deployment process.

How to separate i18n language folders into another repo?

So, we have a React project with +50 languages. We are using i18n with i18n-backend plugin to load the translations. The JSON files with the translations are sitting in the public/locales folder. Inside we have +50 folders, each one named with the language code, and inside each one there's a translation.js file.
The goal is to decouple this from the main repo since making a small copy change inside a bugfix makes PRs with +60 files and it's annoying for code review. Also allows other teams to make changes to the copy easier without interfering with the UI part.
So my question is, how can I move this to another repo?

Wheres the best place to add non npm extensions in Reacts folder structure

I'm building a React webapplication but got multiple JS and CSS extensions (Not available in the node package manager), which I want to integrate into my project.
Since I don't find it pretty to add a vendor folder into the src directory, and also the public folder doesn't seem to be the correct place, what is the best directory or most common used place to add those (as example) Iconfonts, js gallery slider etc.?
There isn't one "right" way to structure your folders. If you don't like the sight of a vendor folder maybe consider creating a "commons" folder and store those packages there. I know it sounds like a cop-out but really just go with whatever makes most sense in your situation.

Meteor unwatch folder

I am trying to make a folder to be not watched. Is there a way to make one of the folders not watched in Meteor? I don't want my project to reload if I change a content in that folder.
Not exactly. Meteor assumes that if the folder content changes, it also needs to reload/restart the server, because the business logic of the application might have changed. Therefore it reloads these files and restarts the server
However, you might be able to "abuse" the tests/ directory or any of the directories/files mentioned below for that purpose. As explained in the Meteor guide on Application Structure, paragraph "Special directories":
Any directory named tests/ is not loaded anywhere. Use this for any test code you want to run using a test runner outside of Meteor’s built-in test tools.
The following directories are also not loaded as part of your app code:
Files/directories whose names start with a dot, like .meteor and .git
packages/: Used for local packages
cordova-build-override/: Used for advanced mobile build customizations
programs: For legacy reasons
So the reasonable choice would be to create a dot directory, e.g. .myStuff, and place anything that you might need to update but do not want to trigger a server restart there.
Just build your app in a package so you can decide which files you want to make available or not :)

Indesign real-time package for collaboration

I manage a team of designers working on Indesign.
When we work on a project, it often happens that a designer has to work on the project of another. We work with Dropbox for Business.
But when we take the work of another designer, there is often missing links and fonts.
Is there a plugin or a way to develop a plugin that would allow, when we create a new indd file (or for the protection of the same file):
Automatically create a "Links" folder and another "Document fonts" at side of the indd file
Systematically add a new link or new typography in the corresponding folder?
To simplify: each action on font or on a link, make a kind of "Indesign Package" in real time?
If this is not a solution, do you have any solutions to meet this need?
I don't know of a specific script or plugin that does this.
However, it should be possible to write a script with an eventhandler with a beforeClose event that runs certain script commands every time a user closes a document (or even every time a user adds, changes or deletes a link). At this point the script could run some copyLink commands on all the images and fonts (?) placing them all in the folders next to the document.
The whole script could be made a startup script, so it becomes active anytime any user runs InDesign.
(I'm actually not sure, if fonts can be copied so easily. Worst case scenario would be that the script would need to run some packaging command to gather the fonts somewhere, copy them over to where you need them and then delete the rest of the temporary package.)
Did you consider Creative Cloud Libraries ? They are meant to allow sharing assets within a team. Apart form that, you users would need to have a same access to the file system (a common drive letter for the network path for example).
Another solution would be to use a DAM solution so users would link files from the DAM.
Eventually, you could sure think of a script as mdomino offered.

Resources