Skip to content
This repository has been archived by the owner on Aug 24, 2024. It is now read-only.

Mark latest directory as Latest #89

Open
wants to merge 1 commit into
base: caddy-v1
Choose a base branch
from

Conversation

jolheiser
Copy link

I haven't have a chance to test yet, wanted to make a PR while it was fresh in my head.

@techknowlogick
Copy link
Owner

Thanks for PR :)

I'm not sure this is where this should be, as looking at the test output latest is true for more than just the current release.

{
  "Path": "/",
  "Folders": [
    "1.1.0",
    "1.1",
    "1.10.0-rc1",
    "1.10.0",
    "1.10",
    "1.11.0",
    "1.2.0-dev",
    "1.2.0",
    "1",
    "one"
  ],
  "Files": {
    "main.txt": {
      "Bytes": 12,
      "Date": "2021-02-05T19:19:50.932Z"
    },
    "second.txt": {
      "Bytes": 14,
      "Date": "2021-02-05T19:19:50.952Z"
    }
  },
  "RenderedDirs": [
    {
      "Name": "1.11.0",
      "Icon": "current",
      "Description": "Current Release 1.11.0",
      "Class": "current",
      "Latest": true
    },
    {
      "Name": "1.10.0",
      "Icon": "release",
      "Description": "Previous Release 1.10.0",
      "Class": "",
      "Latest": false
    },
    {
      "Name": "1.10",
      "Icon": "working",
      "Description": "Development branch for 1.10",
      "Class": "",
      "Latest": true
    },
    {
      "Name": "1.10.0-rc1",
      "Icon": "working",
      "Description": "Release Candidate rc1 for 1.10.0",
      "Class": "",
      "Latest": true
    },
    {
      "Name": "1.2.0",
      "Icon": "release",
      "Description": "Previous Release 1.2.0",
      "Class": "",
      "Latest": false
    },
    {
      "Name": "1.2.0-dev",
      "Icon": "working",
      "Description": "Development branch for 1.2.0",
      "Class": "",
      "Latest": true
    },
    {
      "Name": "1.1.0",
      "Icon": "release",
      "Description": "Previous Release 1.1.0",
      "Class": "",
      "Latest": false
    },
    {
      "Name": "1.1",
      "Icon": "older",
      "Description": "Maintenance branch for 1.1",
      "Class": "",
      "Latest": false
    },
    {
      "Name": "1",
      "Icon": "working",
      "Description": "Development branch for 1",
      "Class": "",
      "Latest": true
    },
    {
      "Name": "one",
      "Icon": "folder",
      "Description": "",
      "Class": "",
      "Latest": false
    }
  ],
  "RenderedFiles": [
    {
      "Name": "main.txt",
      "Icon": "file",
      "Description": "",
      "Class": "",
      "Bytes": 12,
      "Date": "2021-02-05T19:19:50.932Z"
    },
    {
      "Name": "second.txt",
      "Icon": "file",
      "Description": "",
      "Class": "",
      "Bytes": 14,
      "Date": "2021-02-05T19:19:50.952Z"
    }
  ]
}

@jolheiser
Copy link
Author

Yeah....this is tricky because it seems that some of this only applies to customized rendering.

Under semver sorting the first item in the slice would be latest, but I'm not sure what to do if semver sorting is turned off.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants