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

Image media management pipeline #40

Closed
cirosantilli opened this issue Apr 19, 2020 · 0 comments
Closed

Image media management pipeline #40

cirosantilli opened this issue Apr 19, 2020 · 0 comments
Milestone

Comments

@cirosantilli
Copy link
Contributor

cirosantilli commented Apr 19, 2020

cirodown.json can contain media source entries:

"media-providers": {
  "github": {
    "default-for": ["image"], // "all" to default for both image, video and anything else
    "path": "data/media/",  // data is gitignored, but should not be nuked like out/
    "remote": "cirosantilli/cirodown-media", // calculated default from this projects name
    "type": "github" // default from name
  },
  "local": {
    "default-for": ["video"],
    "path": "media/",
    "src": "cirosantilli/cirodown-media",
    "type": "local" // default from name
  },
  "youtube": {}
}

A specific provider for one Image can be selected with {provider=}.

If the src of Image does not start with https?:// then the default media-source is used, and that path is modified according to the selected provider:

  • type: local: added to the same mechanism that uploads HTML content, e.g. in the current git repo
  • type: github: a locally cloned GitHub repo at the latest version. Clone it if not yet cloned. Could be a submodule, but not necessary if you never rename/delete media (so that older versions work), cirodown handles the cloning for you.

default-for is case agnostic on the first character, so that using default-for: "image" works on both Image and image. The default-for` value must always start with a lower case characters.

Advantages:

  • when building the HTML, all media that is not downloaded locally is first downloaded locally, and the local media URLs are used so you can view and develop the website without the internet.

    Media that starts with https? just gets wget downloaded to the out/media cache

    The update is done on the fly only if there is one missing media path locally, to avoid web usage every time. You can use --force-download to always check if we are at latest.

    This will also enable fully embedding images with --html-embed to produce fully self contained documents.

  • when pushing, local media that was used in the build gets committed and pushed automatically to remote.

    This is especially important when we start doing media generation from source code, e.g. images from dot files.

cirodown c167066 actually already has a video source: youtube. That one should be the default actually, so if you write an URL without https? it uses youtube by default, and for local you need {provider=local}.

@cirosantilli cirosantilli added this to the 2 milestone Apr 27, 2020
@cirosantilli cirosantilli modified the milestones: 2, 1 May 4, 2020
cirosantilli added a commit that referenced this issue May 26, 2020
Fix: #65

Fix: #62

Fix: #60

Fix: #40 Split more specific
aspects to other tickets.
cirosantilli added a commit that referenced this issue May 26, 2020
Fix: #65

Fix: #62

Fix: #60

Fix: #40 Split more specific
aspects to other tickets.
cirosantilli added a commit that referenced this issue May 26, 2020
Fix: #65

Fix: #62

Fix: #60

Fix: #40 Split more specific
aspects to other tickets.
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