LEYUN · SITE SPEC & COMPONENT LIBRARY独立站技术规范手册

Document File Naming and Directory Rules

Section:PDF PAGE SPEC · Reviewed:2026-11-20 · Template asset

Key takeawayThis section defines the structure template, field dictionary, integration points and compliance boundaries for 「Document File Naming and Directory Rules」 in PDF PAGE SPEC. Templates are for reference only; verify local regulations and platform rules before launch.

Industries and use cases

  • Sites whose file management breaks down as models and documents multiply
  • Template sites that generate and maintain download pages in bulk
  • Problems caused by Chinese file names that overseas buyers cannot identify after download
  • Sites that want files to be retrievable and understandable to search engines
Template / code snippethtml
<!-- 命名规范 -->
<!--
格式:  {type}-{model}-{lang}-{revision}.{ext}
示例:  datasheet-model-a-en-r3.pdf
        sds-model-a-en-r5.pdf
        cert-iso9001-en-r2.pdf
        dwg-model-a-en-r1.pdf

type    取值:datasheet / sds / tds / cert / dwg / manual / drawing
model   小写连字符,与 URL slug 一致
lang    ISO 639-1 两位代码:en / de / fr / es
revision 修订号 r + 数字,与文件内版本标记一致
-->

<!-- 目录规范 -->
<!--
/files/
  /files/datasheet/{model}/{lang}/
  /files/sds/{model}/{lang}/
  /files/tds/{model}/{lang}/
  /files/cert/{cert-id}/{lang}/
  /files/dwg/{model}/
-->

<!-- 生成命名:模板中统一走这一个函数 -->
<script type="text/template">
  function fileName(type, model, lang, revision, ext) {
    var t = String(type).toLowerCase();
    var m = String(model).toLowerCase()
      .replace(/[^a-z0-9]+/g, '-')
      .replace(/^-+|-+$/g, '');
    var l = String(lang).toLowerCase();
    var r = 'r' + String(revision);
    return [t, m, l, r].join('-') + '.' + ext;
  }
  // datasheet / model-a / en / 3 / pdf
  // → datasheet-model-a-en-r3.pdf
</script>
Fields and parameters
Field / parameterTypeDescription and values
typeEnumdatasheet / sds / tds / cert / dwg / manual
modelTextLowercase with hyphens, identical to the URL slug
langTextISO 639-1 two-letter code
revisionText"r" plus a number, matching the version inside the file
ExtensionTextLowercase, pdf / dwg / step
Directory levelsNoteThree levels: type / model / language

SEO and structured-data notes

SEO and structured-data checkpoints
File names in lowercase EnglishChinese file names are garbled on some systems and in some browsers, and overseas buyers cannot file them
Model identical to the URL slugOne model name across page, URL and file name makes searching and troubleshooting easier
Revision as "r" plus a numberIt carries more information than "final" or "final2" and sorts correctly by default
Two-letter language codesen / de / fr / es align with the hreflang annotation system
Fixed type prefixFiltering by prefix makes bulk generation far less error-prone
No spaces in file namesSpaces need escaping in URLs and cause problems in some download tools

Compliance risk notes

  • Customer names must not appear in file names
  • Names such as "final" or "latest" that cannot be sorted must not be used
  • The same file must not exist under several different names
  • The file name and the version marker inside the file must agree
  • Internal pricing or cost information must not be exposed in file names

Do not reuse this template verbatim in regulated contexts; verify local regulations and platform rules before going live.

Modification example

<!-- Modification example: compare several naming approaches -->
<!-- Poor: cannot be sorted, cannot be searched, contains Chinese characters -->
<a href="/files/product-a-spec-final-latest.pdf">Download</a>

<!-- Poor: looks tidy but carries no version information -->
<a href="/files/datasheet-A-v2.pdf">Download</a>

<!-- Good: type filterable, model traceable, language identifiable, version sortable -->
<a href="/files/datasheet/model-a/en/datasheet-model-a-en-r3.pdf"
   type="application/pdf">
  MODEL-A Datasheet (EN, rev.3)</a>

<!-- The file URL itself carries the full semantics:
     1. /datasheet/ segment → bulk filtering by document type
     2. /model-a/ segment → identical to the product page slug, so it can be traced back
     3. /en/ segment → matches the hreflang language code
     4. -r3.pdf → sorting equals version order

     The link text on the page also states the revision,
     so buyers do not mix up files when archiving them. -->

FAQ

Subdirectories or a flat structure?
Layer by type / model / language. With many models, a flat structure produces thousands of files in one directory and becomes unmanageable.
Must the URL file name match the real file name?
Recommended. Where they differ, downloads frequently fail with file-not-found errors.
Should old versions be kept?
Keep them in an archive path, but list only the current version on the download page. Old versions are mainly used to trace completed orders.
What happens to old links after a rename?
Add a 301 redirect. Renaming does not change the content, but external references break.
Version notes2026-11-20: first release, compiled from official Google documentation and public technical sources; updated as engine rules change. Engine behaviour details follow the latest official Google documentation.

Note: this page is a summary of publicly documented search-engine rules and is for self-check reference only. Engine behaviour is subject to the latest official Google documentation; verify against your own Search Console data.