To teach the laws and the meaning of the festival on the Shabbos before the festival:
[After the Temples destruction, only the students were taught the laws thirty days prior to the festival, however] for the community, the laws of the upcoming festival would be expounded on the Shabbos prior to the festival. On this Shabbos, all the Jews from the villages would gather to hear the laws of the festival from the Rabbi. For this reason, in the latter generations, the custom became that the Rabbi expound on the laws of Pesach on the Shabbos prior, and the laws of the Chag [Sukkos] on Shabbos Shuva.
The content of the speech: The main point of this speech is to expound and teach the people the ways of G-d and teach them what must be done [on the holiday], unlike the custom today [that the speech surrounds other topics].
Shabbos before Shavuos: There is no custom to give a speech on the Shabbos before Shavuos, as it has no laws which are particular to its holiday, as all its laws of what is prohibited are applicable also on the holidays of Pesach and Sukkos.
When is the speech given if Shabbos is Erev Pesach: When the Shabbos prior to Pesach is also Erev Pesach, then the speech is given on the previous Shabbos.
The custom is for the Rabbi to give a speech dealing with the laws of the Holiday on the Shabbos preceding Pesach, [unless that Shabbos is Erev Pesach in which case it is given on the preceding Shabbos] and on Shabbos Shuva.
 Accordingly, the teaching of the laws 30 days prior did become nullified with regards to the townspeople which are not students. Seemingly this reveals that today there is no true obligation to teach thirty days prior, but rather just a custom to teach the laws beforehand.
 This is with exception to when the Shabbos prior falls on Erev Pesach, as will be explained.
 The Shabbos before Sukkos: Admur does not write “the Shabbos before Sukkos“, as Sukkos sometimes falls the week after the week of Shabbos Shuva, as the Shabbos before Yom Kippur is called Shabbos Shuva. With regards to why Admur rules the sermon is to be given on Shabbos Shuva rather than the Shabbos before Sukkos, possibly this is in order so the Rabbi can also include the laws of Yom Kippur in the sermon. The Magen Avraham 429/1 implies that the laws of Yom Kippur are expounded on Shabbos shuva, as well as the laws of Sukkos. See next footnote!
 Regarding the meaning of the phrase “To expound and teach the people the ways of G-d and teach them what must be done [on the holiday]”, In the source of Admur, which is the Magen Avraham there is no wod “and” between the “ways of G-d” and “teach..”, thus one can interpret that teaching the laws is the meaning behind teaching them the ways of G-d. However Admur adds an “and” between these two phrases, and thus one must conclude that in his opinion, they are two different matters. The “ways of G-d” refers to the general teachings in service of G-d. It is for this reason that Admur does not mention that the laws of Yom Kippur have to also be discussed on Shabbos Shuvah, as the main laws of Yom Kippur [which is Teshuvah] is already included in the teachings of the “path of serving G-d”, that is mentioned in the first phrase, and thus there was no need to mention it, just like we do not say the laws before Shavuos, being that they are already included. [Likkutei Sichos vol. 3 “Shabbos Hagadol”]
 Vetzrauch Iyun why below, regarding the speech said on Yom Tov, Admur accepts the custom not to review the laws due to that it’s anyways all written in Sefarim!
 Vetzaruch Iyun from 429/4 which states: “Thus on Atzeres/Shavuos the laws of Atzeres (Shavuos) are expounded”