<!DOCTYPE html><htmllang="ro"><head><metacharSet="utf-8"/><metahttp-equiv="X-UA-Compatible"content="IE=edge"/><title>Versioning · Docusaurus</title><metaname="viewport"content="width=device-width"/><metaname="generator"content="Docusaurus"/><metaname="description"content="You can use the `version` script to cut a new documentation version based on the latest content in the `docs` directory. That specific set of documentation will then be preserved and accessible even as the documentation in the `docs` directory changes moving forward."/><metaname="docsearch:version"content="1.13.0"/><metaname="docsearch:language"content="ro"/><metaproperty="og:title"content="Versioning · Docusaurus"/><metaproperty="og:type"content="website"/><metaproperty="og:url"content="https://docusaurus.io/"/><metaproperty="og:description"content="You can use the `version` script to cut a new documentation version based on the latest content in the `docs` directory. That specific set of documentation will then be preserved and accessible even as the documentation in the `docs` directory changes moving forward."/><metaproperty="og:image"content="https://docusaurus.io/img/docusaurus.png"/><metaname="twitter:card"content="summary"/><metaname="twitter:image"content="https://docusaurus.io/img/docusaurus.png"/><linkrel="shortcut icon"href="/img/docusaurus.ico"/><linkrel="stylesheet"href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><linkrel="stylesheet"href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><linkrel="alternate"type="application/atom+xml"href="https://docusaurus.io/blog/atom.xml"title="Docusaurus Blog ATOM Feed"/><linkrel="alternate"type="application/rss+xml"href="https://docusaurus.io/blog/feed.xml"title="Docusaurus Blog RSS Feed"/><script>
function createToggler(togglerSelector, targetSelector, className) {
var toggler = document.querySelector(togglerSelector);
var target = document.querySelector(targetSelector);
if (!toggler) {
return;
}
toggler.onclick = function(event) {
event.preventDefault();
target.classList.toggle(className);
};
}
});
</script></nav></div><divclass="container mainContainer"><divclass="wrapper"><divclass="post"><headerclass="postHeader"><aclass="edit-page-link button"href="https://crowdin.com/project/docusaurus/ro"target="_blank"rel="noreferrer noopener">Translate</a><h1class="postHeaderTitle">Versioning</h1></header><article><div><span><p>You can use the <code>version</code> script to cut a new documentation version based on the latest content in the <code>docs</code> directory. That specific set of documentation will then be preserved and accessible even as the documentation in the <code>docs</code> directory changes moving forward.</p>
<p>Run the script with a command line argument of the version you wish to create. e.g.,</p>
<pre><codeclass="hljs css language-bash">yarn run version 1.0.0
</code></pre>
<p>This will preserve all documents currently in the <code>docs</code> directory and make them available as documentation for version <code>1.0.0</code>.</p>
<p>If, for example, you ran the version script with <code>1.0.0</code> as the version number, version <code>1.0.0</code> is considered the latest release version for your project. The site will display the version number next to the title in the header. This version number links to a versions page that you created earlier.</p>
<p>Documents in the <code>docs</code> directory will be considered part of version <code>next</code> and they are available, for example, at the URL <code>docs/next/doc1.html</code>. Documents from the latest version use the URL <code>docs/doc1.html</code>.</p>
<p>Running the script again with <code>yarn run version 2.0.0</code> will create a version <code>2.0.0</code>, making version <code>2.0.0</code> the most recent set of documentation. Documents from version <code>1.0.0</code> will use the URL <code>docs/1.0.0/doc1.html</code> while <code>2.0.0</code> will use <code>docs/doc1.html</code>.</p>
<p>This table below summarizes Docusaurus versioning at a glance:</p>
<p>You can create version numbers in whatever format you wish, and a new version can be created with any version number as long as it does not match an existing version. Version ordering is determined by the order in which versions are created, independently of how they are numbered.</p>
<p>Versioned documents are placed into <code>website/versioned_docs/version-${version}</code>, where <code>${version}</code> is the version number you supplied the <code>version</code> script.</p>
<p>The markdown header for each versioned doc is altered by renaming the id front matter field to <code>original_id</code>, then using <code>"version-${version}-${original_id}"</code> as the value for the actual <code>id</code> field.</p>
<p>Versioned sidebars are copied into <code>website/versioned_sidebars</code> and are named as <code>version-${version}-sidebars.json</code>.</p>
<p>A <code>website/versions.json</code> file is created the first time you cut a version and is used by Docusaurus to detect what versions exist. Each time a new version is added, it gets added to the <code>versions.json</code> file.</p>
<p>If you wish to change the documentation for a past version, you can access the files for that respective version.</p>
<p>Only files in the <code>docs</code> directory and sidebar files that differ from those of the latest version will get copied each time a new version is specified. If there is no change across versions, Docusaurus will use the file from the latest version with that file.</p>
<p>For example, a document with the original id <code>doc1</code> exists for the latest version, <code>1.0.0</code>, and has the same content as the document with the id <code>doc1</code> in the <code>docs</code> directory. When a new version <code>2.0.0</code> is created, the file for <code>doc1</code> will not be copied into <code>versioned_docs/version-2.0.0/</code>. There will still be a page for <code>docs/2.0.0/doc1.html</code>, but it will use the file from version <code>1.0.0</code>.</p>
<p>If you wish to use versioning and translations features, the <code>crowdin.yaml</code> file should be set up to upload and download versioned documents to and from Crowdin for translation. Translated, versioned files will go into the directory <code>translated_docs/${language}/version-${version}/</code>. For more information, check out the <ahref="/docs/ro/translation">translations guide</a>.</p>
</span></div></article></div><divclass="docs-prevnext"><aclass="docs-prev button"href="/docs/ro/translation"><spanclass="arrow-prev">← </span><span>Translations & Localization</span></a><aclass="docs-next button"href="/docs/ro/commands"><span>CLI Commands</span><spanclass="arrow-next"> →</span></a></div></div></div><navclass="onPageNav"><ulclass="toc-headings"><li><ahref="#cum-să-creezi-versiuni-noi">Cum să creezi versiuni noi</a></li><li><ahref="#tipare-de-versionare">Tipare de versionare</a></li><li><ahref="#fișiere-de-stocare-pentru-fiecare-versiune">Fișiere de stocare pentru fiecare versiune</a></li><li><ahref="#funcționalitate-fallback">Funcționalitate Fallback</a></li><li><ahref="#redenuming-versiunile-existente">Redenuming versiunile existente</a></li><li><ahref="#versionări-și-traduceri">Versionări și Traduceri</a></li></ul></nav></div><footerclass="nav-footer"id="footer"><sectionclass="sitemap"><ahref="/"class="nav-home"><imgsrc="/img/docusaurus_monochrome.svg"alt="Docusaurus"width="66"height="58"/></a><divclass="footerSection"><h5>Docs</h5><ahref="